3.6 \(\int \frac {(d+e x) (a+b \log (c x^n))}{x^2} \, dx\)

Optimal. Leaf size=48 \[ -\frac {d \left (a+b \log \left (c x^n\right )\right )}{x}+\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{2 b n}-\frac {b d n}{x} \]

[Out]

-b*d*n/x-d*(a+b*ln(c*x^n))/x+1/2*e*(a+b*ln(c*x^n))^2/b/n

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 43, normalized size of antiderivative = 0.90, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {43, 2334, 14, 2301} \[ -\left (\frac {d}{x}-e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-\frac {b d n}{x}-\frac {1}{2} b e n \log ^2(x) \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x)*(a + b*Log[c*x^n]))/x^2,x]

[Out]

-((b*d*n)/x) - (b*e*n*Log[x]^2)/2 - (d/x - e*Log[x])*(a + b*Log[c*x^n])

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2301

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2334

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]
] /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rubi steps

\begin {align*} \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx &=-\left (\frac {d}{x}-e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \frac {-d+e x \log (x)}{x^2} \, dx\\ &=-\left (\frac {d}{x}-e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \left (-\frac {d}{x^2}+\frac {e \log (x)}{x}\right ) \, dx\\ &=-\frac {b d n}{x}-\left (\frac {d}{x}-e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )-(b e n) \int \frac {\log (x)}{x} \, dx\\ &=-\frac {b d n}{x}-\frac {1}{2} b e n \log ^2(x)-\left (\frac {d}{x}-e \log (x)\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 48, normalized size = 1.00 \[ -\frac {d \left (a+b \log \left (c x^n\right )\right )}{x}+\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{2 b n}-\frac {b d n}{x} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x)*(a + b*Log[c*x^n]))/x^2,x]

[Out]

-((b*d*n)/x) - (d*(a + b*Log[c*x^n]))/x + (e*(a + b*Log[c*x^n])^2)/(2*b*n)

________________________________________________________________________________________

fricas [A]  time = 0.47, size = 50, normalized size = 1.04 \[ \frac {b e n x \log \relax (x)^{2} - 2 \, b d n - 2 \, b d \log \relax (c) - 2 \, a d + 2 \, {\left (b e x \log \relax (c) - b d n + a e x\right )} \log \relax (x)}{2 \, x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))/x^2,x, algorithm="fricas")

[Out]

1/2*(b*e*n*x*log(x)^2 - 2*b*d*n - 2*b*d*log(c) - 2*a*d + 2*(b*e*x*log(c) - b*d*n + a*e*x)*log(x))/x

________________________________________________________________________________________

giac [A]  time = 0.33, size = 56, normalized size = 1.17 \[ \frac {b n x e \log \relax (x)^{2} + 2 \, b x e \log \relax (c) \log \relax (x) - 2 \, b d n \log \relax (x) + 2 \, a x e \log \relax (x) - 2 \, b d n - 2 \, b d \log \relax (c) - 2 \, a d}{2 \, x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))/x^2,x, algorithm="giac")

[Out]

1/2*(b*n*x*e*log(x)^2 + 2*b*x*e*log(c)*log(x) - 2*b*d*n*log(x) + 2*a*x*e*log(x) - 2*b*d*n - 2*b*d*log(c) - 2*a
*d)/x

________________________________________________________________________________________

maple [C]  time = 0.24, size = 250, normalized size = 5.21 \[ -\frac {\left (-e x \ln \relax (x )+d \right ) b \ln \left (x^{n}\right )}{x}-\frac {i \pi b e x \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right ) \ln \relax (x )-i \pi b e x \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \ln \relax (x )-i \pi b e x \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \ln \relax (x )+i \pi b e x \mathrm {csgn}\left (i c \,x^{n}\right )^{3} \ln \relax (x )+b e n x \ln \relax (x )^{2}-i \pi b d \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )+i \pi b d \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}+i \pi b d \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}-i \pi b d \mathrm {csgn}\left (i c \,x^{n}\right )^{3}-2 b e x \ln \relax (c ) \ln \relax (x )-2 a e x \ln \relax (x )+2 b d n +2 b d \ln \relax (c )+2 a d}{2 x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)*(b*ln(c*x^n)+a)/x^2,x)

[Out]

-b*(-e*x*ln(x)+d)/x*ln(x^n)-1/2*(-I*ln(x)*Pi*b*e*csgn(I*x^n)*csgn(I*c*x^n)^2*x+I*ln(x)*Pi*b*e*csgn(I*x^n)*csgn
(I*c*x^n)*csgn(I*c)*x+I*ln(x)*Pi*b*e*csgn(I*c*x^n)^3*x-I*ln(x)*Pi*b*e*csgn(I*c*x^n)^2*csgn(I*c)*x+I*Pi*b*d*csg
n(I*x^n)*csgn(I*c*x^n)^2-I*Pi*b*d*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-I*Pi*b*d*csgn(I*c*x^n)^3+I*Pi*b*d*csgn(I
*c*x^n)^2*csgn(I*c)+b*e*n*ln(x)^2*x-2*ln(x)*ln(c)*b*e*x-2*ln(x)*a*e*x+2*ln(c)*b*d+2*b*d*n+2*a*d)/x

________________________________________________________________________________________

maxima [A]  time = 0.83, size = 49, normalized size = 1.02 \[ \frac {b e \log \left (c x^{n}\right )^{2}}{2 \, n} + a e \log \relax (x) - \frac {b d n}{x} - \frac {b d \log \left (c x^{n}\right )}{x} - \frac {a d}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))/x^2,x, algorithm="maxima")

[Out]

1/2*b*e*log(c*x^n)^2/n + a*e*log(x) - b*d*n/x - b*d*log(c*x^n)/x - a*d/x

________________________________________________________________________________________

mupad [B]  time = 3.57, size = 59, normalized size = 1.23 \[ \ln \relax (x)\,\left (a\,e+b\,e\,n\right )-\frac {a\,d+b\,d\,n}{x}-\frac {\ln \left (c\,x^n\right )\,\left (b\,d+b\,e\,x\right )}{x}+\frac {b\,e\,{\ln \left (c\,x^n\right )}^2}{2\,n} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((a + b*log(c*x^n))*(d + e*x))/x^2,x)

[Out]

log(x)*(a*e + b*e*n) - (a*d + b*d*n)/x - (log(c*x^n)*(b*d + b*e*x))/x + (b*e*log(c*x^n)^2)/(2*n)

________________________________________________________________________________________

sympy [A]  time = 4.98, size = 53, normalized size = 1.10 \[ - \frac {a d}{x} + a e \log {\relax (x )} + b d \left (- \frac {n}{x} - \frac {\log {\left (c x^{n} \right )}}{x}\right ) - b e \left (\begin {cases} - \log {\relax (c )} \log {\relax (x )} & \text {for}\: n = 0 \\- \frac {\log {\left (c x^{n} \right )}^{2}}{2 n} & \text {otherwise} \end {cases}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*ln(c*x**n))/x**2,x)

[Out]

-a*d/x + a*e*log(x) + b*d*(-n/x - log(c*x**n)/x) - b*e*Piecewise((-log(c)*log(x), Eq(n, 0)), (-log(c*x**n)**2/
(2*n), True))

________________________________________________________________________________________